<?php

namespace Client\Form;

use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use \Zend\Form\Form;

class ClientCriteriaFormFactory implements FactoryInterface {

    public function createService(ServiceLocatorInterface $serviceLocator) {
        $form = new Form('client');
        $form->setAttribute('method', 'post');

       

        $form->add(array(
            'name' => 'firstName',
            'type' => 'text',
            'options' => array(
                'label' => 'First Name',
            ),
        ));
        $form->add(array(
            'name' => 'lastName',
            'type' => 'text',
            'options' => array(
                'label' => 'Last Name',
            ),
        ));
        $form->add(array(
            'name' => 'adres',
            'type' => 'text',
            'options' => array(
                'label' => 'Adres',
            ),
        ));
        $form->add(array(
            'name' => 'phone',
            'type' => 'text',
            'options' => array(
                'label' => 'Phone',
            ),
        ));
        $form->add(array(
            'name' => 'submit',
            'type' => 'submit',
            'attributes' => array(
                'value' => 'Find',
                'id' => 'submitbutton',
            ),
        ));

        $inputFilter = $serviceLocator->get('Client\Form\ClientCriteriaFilter');
        $form->setInputFilter($inputFilter);
        
        $form->setHydrator(new \Zend\Stdlib\Hydrator\ClassMethods(false));

        return $form;
    }

}